package com.lin.dataobject;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lin.enums.OrderStatusEnum;
import com.lin.enums.PayStatusEnum;
import com.lin.utils.serializer.Date2LongSerializer;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by Administrator on 2017/8/29.
 */
@Entity
@DynamicUpdate
@Data
@Table(name = "order_master")
public class OrderMaster {

    @Id
    private String orderId;

    private String buyerName;

    private String buyerPhone;

    private String buyerAddress;

    private String buyerOpenid;

    private BigDecimal orderAmount;

    private Integer orderStatus= OrderStatusEnum.New.getCode();

    private Integer payStatus= PayStatusEnum.Wait.getCode();

//    @JsonSerialize(using = Date2LongSerializer.class)
    private Date createTime;
}
